﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace Toon.Controls
{
	public partial class LabeledTextBlock : Control
	{
		public LabeledTextBlock()
		{
			DefaultStyleKey = typeof(LabeledTextBlock);
		}


	}

	public partial class LabeledTextBlock : Control
	{
		public static readonly DependencyProperty LabelStyleProperty = DependencyProperty.Register("LabelStyle", typeof(Style), typeof(LabeledTextBlock), new PropertyMetadata(null, OnLabelStyleChanged));

		private static void OnLabelStyleChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
		{
			LabeledTextBlock labeledTextBlock = o as LabeledTextBlock;
			if (labeledTextBlock != null)
				labeledTextBlock.OnLabelStyleChanged((Style)e.OldValue, (Style)e.NewValue);
		}

		public Style LabelStyle
		{
			get { return (Style)GetValue(LabelStyleProperty); }
			set { SetValue(LabelStyleProperty, value); }
		}

		protected virtual void OnLabelStyleChanged(Style oldValue, Style newValue)
		{
			LabelStyleChanged(oldValue, newValue);
		}

		partial void LabelStyleChanged(Style oldValue, Style newValue);



		public static readonly DependencyProperty TextStyleProperty = DependencyProperty.Register("TextStyle", typeof(Style), typeof(LabeledTextBlock), new PropertyMetadata(null, new PropertyChangedCallback(OnTextStyleChanged)));

		private static void OnTextStyleChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
		{
			LabeledTextBlock labeledTextBlock = o as LabeledTextBlock;
			if (labeledTextBlock != null)
				labeledTextBlock.OnTextStyleChanged((Style)e.OldValue, (Style)e.NewValue);
		}

		protected virtual void OnTextStyleChanged(Style oldValue, Style newValue)
		{
			TextStyleChanged(oldValue, newValue);
		}

		partial void TextStyleChanged(Style oldValue, Style newValue);

		public Style TextStyle
		{
			get { return (Style)GetValue(TextStyleProperty); }
			set { SetValue(TextStyleProperty, value); }
		}


		public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(LabeledTextBlock), new PropertyMetadata("", new PropertyChangedCallback(OnTextChanged)));

		private static void OnTextChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
		{
			LabeledTextBlock labeledTextBlock = o as LabeledTextBlock;
			if (labeledTextBlock != null)
				labeledTextBlock.OnTextChanged((string)e.OldValue, (string)e.NewValue);
		}


		partial void TextChanged(string oldValue, string newValue);

		protected virtual void OnTextChanged(string oldValue, string newValue)
		{
			TextChanged(oldValue, newValue);
		}

		public string Text
		{
			get { return (string)GetValue(TextProperty); }
			set { SetValue(TextProperty, value); }
		}

		public static readonly DependencyProperty LabelContentProperty = DependencyProperty.Register("LabelContent", typeof(object), typeof(LabeledTextBlock), new PropertyMetadata(null, new PropertyChangedCallback(OnLabelContentChanged)));

		private static void OnLabelContentChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
		{
			LabeledTextBlock labeledTextBlock = o as LabeledTextBlock;
			if (labeledTextBlock != null)
				labeledTextBlock.OnLabelContentChanged((object)e.OldValue, (object)e.NewValue);
		}

		partial void LabelContentChanged(object oldValue, object newValue);
		protected virtual void OnLabelContentChanged(object oldValue, object newValue)
		{
			LabelContentChanged(oldValue, newValue);
		}

		public object LabelContent
		{
			get { return (object)GetValue(LabelContentProperty); }
			set { SetValue(LabelContentProperty, value); }
		}
	}
}
